package com.epfresh.bean;

public class Address {

    private String addressFour;
    private String addressFourId;

    public String getAddressFourId() {
        return addressFourId;
    }

    public void setAddressFourId(String addressFourId) {
        this.addressFourId = addressFourId;
    }

    public String getAddressFour() {
        return addressFour;
    }

    public void setAddressFour(String addressFour) {
        this.addressFour = addressFour;
    }

    private String id;
    private String provinceId;
    private String cityId;
    private String districtId;
    private String streetId;
    private String street;
    //    private String poiAddress;
    private boolean isDefault;
    private boolean isDeleted;
    private String accountId;
    private String provinceName;

    private String cityName;
    private String districtName;
    private String name;

    private String phone;
    private String postcode;
    private String fullDistrictName;
    //地图选择的地址
    private String addressOnMap;
    //用户输入的地址
    private String address;
    //经度
    private String lng;
    //纬度
    private String lat;

    private boolean isSelect;
    private boolean haveSelect;

    public boolean isHaveSelect() {
        return haveSelect;
    }

    public void setHaveSelect(boolean haveSelect) {
        this.haveSelect = haveSelect;
    }

    public Address() {
    }

    public Address(String id, String provinceId, String cityId, String districtId, String address, boolean isDefault, boolean isDeleted, String accountId, String provinceName, String cityName, String districtName, String name, String phone, String postcode, String fullDistrictName) {
        this.id = id;
        this.provinceId = provinceId;
        this.cityId = cityId;
        this.districtId = districtId;
        this.address = address;
        this.isDefault = isDefault;
        this.isDeleted = isDeleted;
        this.accountId = accountId;
        this.provinceName = provinceName;
        this.cityName = cityName;
        this.districtName = districtName;
        this.name = name;
        this.phone = phone;
        this.postcode = postcode;
        this.fullDistrictName = fullDistrictName;
    }

    public String getStreetId() {
        return streetId;
    }

    public void setStreetId(String streetId) {
        this.streetId = streetId;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = true;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getDistrictId() {
        return districtId;
    }

    public void setDistrictId(String districtId) {
        this.districtId = districtId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public boolean isDefault() {
        return isDefault;
    }

    public void setIsDefault(boolean isDefault) {
        this.isDefault = isDefault;
    }

    public boolean isDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getAccountId() {
        return accountId;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public String getFullDistrictName() {
        return fullDistrictName;
    }

    public void setFullDistrictName(String fullDistrictName) {
        this.fullDistrictName = fullDistrictName;
    }

    public String getAddressOnMap() {
        return addressOnMap;
    }

    public void setAddressOnMap(String addressOnMap) {
        this.addressOnMap = addressOnMap;
    }

    public String getLng() {
        return lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getPoiAddress() {
        if (addressOnMap == null || "".equals(addressOnMap)) {
            addressOnMap = "";
        }
        addressOnMap += "|" + lat + "," + lng;
        return addressOnMap;
    }


    public String getAddressStr() {
        StringBuilder s = new StringBuilder();

        if(provinceName != null && !"".equals(provinceName)){
            s.append(provinceName);
            s.append(" ");
        }

        if (cityName != null && !"".equals(cityName)) {
            s.append(cityName);
        }
        if (districtName != null && !"".equals(districtName)) {
            s.append(" ");
            s.append(districtName);
        }
        if (street != null && !"".equals(street)) {
            s.append(" ");
            s.append(street);
        }
//        if (addressOnMap != null && !"".equals(addressOnMap)) {
//            if (s.length() > 0) {
//                s.append(" ");
//            }
//            s.append(addressOnMap);
//        }

        if (address != null && !"".equals(address)) {
            if (s.length() > 0) {
                s.append(" ");
            }
            s.append(address);
        }

        return s.toString();
    }
    public String getDetailAddressStr() {
        StringBuilder s = new StringBuilder();

        if (provinceName != null && !"".equals(provinceName) && !provinceName.equals(cityName)) {
            s.append(provinceName);
        }
        if (cityName != null && !"".equals(cityName)) {
            if (s.length() > 0) {
                s.append(" ");
            }
            s.append(cityName);
        }
        if (districtName != null && !"".equals(districtName)) {
            if (s.length() > 0) {
                s.append(" ");
            }
            s.append(districtName);
        }

        if (address != null && !"".equals(address)) {
            if (s.length() > 0) {
                s.append(" ");
            }
            s.append(address);
        }

        return s.toString();
    }
//    public String getAreaAddressStr(){
//        StringBuilder s = new StringBuilder();
//
//        if (addressOnMap != null && !"".equals(addressOnMap)){
//            s.append(addressOnMap);
//        }
//
//        if (address != null &&!"".equals(address)){
//            if (s.length() > 0){
//                s.append(" ");
//            }
//            s.append(address);
//        }
//
//        return s.toString();
//    }


}
